package com.example.a02back.utils;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.auth0.jwt.JWT;

import com.auth0.jwt.algorithms.Algorithm;

/**
 * @ClassName tokenUtils
 * @Description
 * @Author SimpChaos
 * @Date 2022/7/7 15:55
 * @Version 1.0
 **/
public class tokenUtils {

/**
    public String getToken(String openid) {
        Date start = new Date();
        long currentTime = System.currentTimeMillis() + 1000*1800;//半小时有效时间
        Date end = new Date(currentTime);
        String token = "";

        token = JWT.create().withClaim("openid", openid).withIssuedAt(start).withExpiresAt(end)
                .sign(Algorithm.HMAC256(openid));//创造
        return token;

    }
*/

}
